package com.hd.sup.modules.alarm.model;

import java.io.Serializable;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hd.common.utils.GenUtil;
import lombok.*;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author chentl123
 * @since 2021-01-07
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sp_alarm_rule_vehicle")
public class AlarmRuleVehicle extends Model<AlarmRuleVehicle> {

    private static final long serialVersionUID = 1L;

    //查询构造
    public AlarmRuleVehicle(String ruleId, String enterpriseNo, String enterpriseName, String platNo, String regionCode) {
        this.ruleId = ruleId;
        this.enterpriseNo = enterpriseNo;
        this.enterpriseName = enterpriseName;
        this.platNo = platNo;
        this.regionCode = regionCode;
    }

    //插入构造
    public AlarmRuleVehicle(String ruleId, String transType) {
        this.id = GenUtil.newId();
        this.ruleId = ruleId;
        this.transType = transType;
    }


    /**
     * 业务id
     */
    private String id;
    /**
     * 车辆运输类型
     */
    @TableField("trans_type")
    private String transType;
    /**
     * 规则业务id
     */
    @TableField("rule_id")
    private String ruleId;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;


    @TableField(exist = false)
    private String enterpriseName;
    @TableField(exist = false)
    private String enterpriseNo;
    @TableField(exist = false)
    private String platNo;
    @TableField(exist = false)
    private String regionCode;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
